Use CSS syntax for drop highlighting
authorMatthias Clasen <mclasen@redhat.com>
Thu, 24 Dec 2015 23:04:15 +0000 (18:04 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 26 Dec 2015 03:58:28 +0000 (22:58 -0500)
I hadn't noticed the :drop() pseudo state in the CSS4 Selectors
spec when I added this a while ago. This commit renames
GTK_STATE_FLAG_DND to GTK_STATE_FLAG_DROP_ACTIVE and adds
:drop(active) as equivalent to the :dnd pseudo state.

gtk/gtkcssselector.c
gtk/gtkdnd.c
gtk/gtkenums.h

index 0db8c368df8bc765525f77853918a4ad70f8146f..e41dc0f766e80a0b83d35768279e1fb12e60bc11 100644 (file)
@@ -1192,7 +1192,9 @@ parse_selector_pseudo_class (GtkCssParser   *parser,
     { "link",         GTK_STATE_FLAG_LINK, },
     { "visited",      GTK_STATE_FLAG_VISITED, },
     { "checked",      GTK_STATE_FLAG_CHECKED, },
-    { "dnd"    ,      GTK_STATE_FLAG_DND, }
+    { "dnd",          GTK_STATE_FLAG_DROP_ACTIVE, },
+    { "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE, }
+
   };
   guint i;
 
index 25ed2989429f59a135ae4972869ceb2eb6985704..95cafaa63af8f2221b6036e6c679514d72c717db 100644 (file)
@@ -980,7 +980,7 @@ gtk_drag_highlight (GtkWidget  *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DND, FALSE);
+  gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE, FALSE);
 }
 
 /**
@@ -995,7 +995,7 @@ gtk_drag_unhighlight (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DND);
+  gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
 }
 
 static void
index 3d99fd91d2a8aefd37aad0223c0d315c25ddcb21..18e2895c99554148aa1ce0334d2465f5c7599b8a 100644 (file)
@@ -857,7 +857,7 @@ typedef enum
  * @GTK_STATE_FLAG_LINK: Widget is a link. Since 3.12
  * @GTK_STATE_FLAG_VISITED: The location the widget points to has already been visited. Since 3.12
  * @GTK_STATE_FLAG_CHECKED: Widget is checked. Since 3.14
- * @GTK_STATE_FLAG_DND: Widget is highlighted as a drop target for DND. Since 3.20
+ * @GTK_STATE_FLAG_DROP_ACTIVE: Widget is highlighted as a drop target for DND. Since 3.20
  *
  * Describes a widget state. Widget states are used to match the widget
  * against CSS pseudo-classes. Note that GTK extends the regular CSS
@@ -878,7 +878,7 @@ typedef enum
   GTK_STATE_FLAG_LINK         = 1 << 9,
   GTK_STATE_FLAG_VISITED      = 1 << 10,
   GTK_STATE_FLAG_CHECKED      = 1 << 11,
-  GTK_STATE_FLAG_DND          = 1 << 12
+  GTK_STATE_FLAG_DROP_ACTIVE  = 1 << 12
 } GtkStateFlags;
 
 /**